1. Field of the Invention
The present invention relates to a method and an apparatus for detecting the inclination of image data read by an optical character reader of a character recognition system or a computer graphics system.
2. Description of the Prior Art
FIG. 1 is a view showing an example of picking up character regions according to a character recognition technique. In the figure, a document 1 has image data. The document 1 is scanned by a scanner, and the number of black dots of the image data are accumulated in a lateral direction (parallel to a scanning direction) as well as in a longitudinal direction (perpendicular to the scanning direction) to obtain a distribution (distribution projection) 2 of the black dots. Based on the distribution 2, horizontal and vertical positions of the individual character regions are estimated to determine regions to pick up.
According to this technique, the individual character regions may correctly be picked up only when the document 1 is correctly positioned with respect to the scanning direction of the scanner as shown in FIG. 1, because the distribution may present steep changes and clearly show the character regions only with such a correct positioning.
If the document 1 is obliquely positioned with respect to the scanning direction of the scanner as shown in FIG. 2, the distribution projection does not correctly reflect the character regions so that the character regions may not be picked up correctly. It is necessary, therefore, to detect and correct the inclination of the image before picking up the character regions.
As a method for detecting the inclination of an image, it has been proposed to put reference marks on a document or use edges of the document and measure a time difference of the marks or the edges when they pass the scanner. However, this method is unable to detect the inclination of characters that are oblique with respect to the document.
There is another method for detecting the inclination. This method obtains distribution projections in plural directions of an input image in detecting the inclination of the image. However, this method requires many computations to determine the inclination, thus a long processing time.